package com.example.skillcinema.di

import com.example.skillcinema.db.localdb.ApplicationDataBase
import com.example.skillcinema.db.repositories.FilmForPreviewRepository
import com.example.skillcinema.db.repositories.FilmRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.scopes.ViewModelScoped

@Module
@InstallIn(ViewModelComponent::class)
object ViewModelModules {

    @Provides
    @ViewModelScoped
    fun provideFilmForPreviewRepository(db: ApplicationDataBase): FilmForPreviewRepository =
        FilmForPreviewRepository(db)

    @Provides
    @ViewModelScoped
    fun provideFilmRepository(db: ApplicationDataBase): FilmRepository = FilmRepository(db)
}